Q-Learning
Tags: #◇Computer Science #◇CSINTSY #◇Q-Learning #◇Problem Solving #◇M6
◇Overview
Q-Learning is a Reinforcement Learning algorithm used when the agent does not know the transition probabilities or the reward distribution of an environment beforehand. Because the agent lacks a model of the world (unlike in MDPs), it must learn the optimal policy by exploring the environment and experiencing the rewards and transitions firsthand.
Q-Table:
The algorithm uses a lookup table (Q-table) to store the estimated Q-values for every state-action pair. The Q-value represents the expected total cumulative reward of taking a specific action from a specific state and acting optimally thereafter.
Exploration vs. Exploitation:
During training, the agent faces a trade-off: Exploration: Taking random actions to discover new states and potentially higher rewards. Exploitation: Choosing the best-known action based on current Q-values to maximize reward.
Typically, agents start with high exploration and gradually shift to exploitation as they learn the environment.
Deep Q-Learning:
For environments with vast or continuous state spaces, maintaining a Q-table becomes impossible. Deep Q-Learning replaces the Q-table with a deep neural network that approximates the Q-value for any given state-action pair.
◇Important Formulas
Q-Learning Update Rule:
When an agent takes action in state , transitions to state , and receives reward , the Q-value is updated:
Where: is the learning rate. is the discount factor. is the highest expected reward from the next state .
◇Worked Examples
Frozen Lake Problem:
An agent must navigate a slippery grid from start to goal without falling into holes. The agent intends to move 'Up', but there is a chance it slips 'Left' or 'Right'. Training:
- Initialize Q-table to 0.
- The agent picks an action (randomly or optimally).
- The agent observes the outcome state and reward.
- The Q-table is updated using the outcome.
- Repeat until the end of the episode. Over hundreds of episodes, the agent's Q-table converges, and the optimal policy naturally avoids holes and slippery edges leading to danger.
◇References & Navigation
- Previous Topic: ◇Markov Decision Processes
- Next Topic: ◇State Based Model
- Related Notes: ◇Q Learning
ACTIVE RECALL VERIFICATION
Select an answer to verify conceptual comprehension and reveal the technical rationale.
Why is Q-Learning used instead of standard Markov Decision Processes (MDPs) in certain environments?
In Q-Learning, what does a Q-value stored in the lookup table (Q-table) represent?
What does "Exploitation" refer to during the training of a Q-Learning agent?
When is Deep Q-Learning typically implemented?
In the Q-Learning Update Rule, what is the role of the parameter ?